import apiClient from '@/api/apiClient';
import { Dictionaries } from '@/pages/setting/dictionary/type';

const list = (data?: any) => apiClient.get({ url: '/dict-type', params: data });

const edit = (id: string, data: Dictionaries) =>
  apiClient.put({
    url: `/dict-type/${id}`,
    data,
  });

const remove = (data: { ids: string[] }) => apiClient.delete<number>({ url: `/dict-type`, data });

const add = (data: Dictionaries) =>
  apiClient.post({
    url: `/dict-type`,
    data,
  });

export default {
  list,
  edit,
  add,
  remove,
};
